package com.x.attendance.assemble.control.jaxrs.attendance;

import com.x.base.core.project.http.ActionResult;
import com.x.base.core.project.http.EffectivePerson;
import com.x.base.core.project.logger.Logger;
import com.x.base.core.project.logger.LoggerFactory;

public class ActionGetAttendanceStatistics extends BaseAction {

    private static Logger logger = LoggerFactory.getLogger(ActionGetAttendanceStatistics.class);

    public ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
        ActionResult<Wo> result = new ActionResult<>();
        
        try {
            // TODO: 实现获取考勤统计逻辑
            Wo wo = new Wo();
            wo.setTotalEmployees(0);
            wo.setTodayRecords(0);
            wo.setOnlineDevices(0);
            result.setData(wo);
        } catch (Exception e) {
            logger.error(e);
            throw e;
        }
        
        return result;
    }

    public static class Wo {
        private Integer totalEmployees;
        private Integer todayRecords;
        private Integer onlineDevices;

        public Integer getTotalEmployees() {
            return totalEmployees;
        }

        public void setTotalEmployees(Integer totalEmployees) {
            this.totalEmployees = totalEmployees;
        }

        public Integer getTodayRecords() {
            return todayRecords;
        }

        public void setTodayRecords(Integer todayRecords) {
            this.todayRecords = todayRecords;
        }

        public Integer getOnlineDevices() {
            return onlineDevices;
        }

        public void setOnlineDevices(Integer onlineDevices) {
            this.onlineDevices = onlineDevices;
        }
    }
}

